package com.bicycle.rentalsystem.dao.impl.admin;

import com.bicycle.rentalsystem.dao.admin.RechargeDao;
import com.bicycle.rentalsystem.pojo.admin.Recharge;

import java.util.List;


/**
 * 充值记录数据层实现类
 * 用于实现充值记录数据层接口
 */
public class RechargeDaoImpl extends BaseDao implements RechargeDao{

    @Override
    public List<Recharge> queryForPageItems(Integer begin, Integer pageSize) {
        String sql="SELECT username ,TIME,amount FROM recharge LIMIT ?,?";
        List<Recharge> list = queryForList(Recharge.class, sql, begin, pageSize);
        return list;
    }

    @Override
    public Integer queryForPageTotalCount() {
        String sql="select count(*) from recharge";
        Object o = queryForSingleValue(sql);
        String s = o.toString();
        Integer a= Integer.valueOf(s);
        return a;
    }

}
